
import Cookies from "js-cookie";
import loginTest from "./loginTest"
export const identity = {
    districtLeaders:['区委领导','区政府领导','区人大领导','区政协领导'], //区领导（也是超级管理员）
    superManagement:['区投促局', '超级管理员','区投推和企服中心'], //超级管理员
}

export let turnDept = Cookies.get('user_deptName') || loginTest.user_deptName
export let realityName = Cookies.get('user_realityName') || loginTest.user_realityName
export let isDistrictLeaders = identity['districtLeaders'].includes(turnDept) //区领导
export let isSuperManagement = identity['superManagement'].includes(turnDept) //超级管理员
export let normalUser = !isDistrictLeaders && !isSuperManagement?true:false //普通用户

let loginUserTypeLoad = ()=>{
    //1-区领导 2-普通用户 3-超管
    if(isDistrictLeaders){
        return 1
    }else if(isSuperManagement){
        return 3
    }else{
        return 2
    }
}
export let loginUserType = loginUserTypeLoad()

export const loginUserTypes = (type:any) => {
    //1-区领导 2-普通用户 3-超管
    if(identity['districtLeaders'].includes(type || Cookies.get('user_deptName'))){
        return 1
    }else if(identity['superManagement'].includes(type || Cookies.get('user_deptName'))){
        return 3
    }else{
        return 2
    }
}